<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>防洪</title>
</head>

<body>
    <input type="text">
    <button>计算</button>
    <p></p>

</body>
<script>
    (function () {
        let inp = document.querySelector('input');
        let p = document.querySelector('p');
        let btn = document.querySelector('button');

        btn.addEventListener('click', () => {
            p.innerHTML = `${parseInt(inp.value / 24)}天${inp.value % 24}小时`;
        })
    })();
</script>

</html>